package com.junmoo.www.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Set;

/**
 * @author dpwang
 */
@ToString
@EqualsAndHashCode(callSuper = false)
@Data
@Accessors(chain = true)
@TableName("sys_role")
public class SysRole extends BasicEntity  {
    @TableField("role_id")
    @TableId(value = "role_id",type = IdType.ASSIGN_ID)
    @JsonSerialize(using= ToStringSerializer.class)
    private Long id;

    private String roleName;

    private String roleCode;

    private String roleDesc;
    @TableField(exist = false)
    private Set<SysMenu> resources;
}
